def print_table_header():
    print('+' + '-' * 67 + '+')
    print("|%s|%s|%s|" % (
         'name'.center(25), 'team'.center(30), 'position'.center(10)
    ))
    print('+' + '-' * 67 + '+')

def print_player_info(player_info):
    print("|%s|%s|%s|" % 
          (player_info['name'].center(25),
           player_info['team'].center(30), 
           player_info['position'].center(10),
          ))

player_infos = """Carmelo Anthony,Portland Trail Blazers,SF; 
Anthony Davis,Los Angeles Lakers,PF;
LeBron James,Los Angeles Lakers,SF;
Kevin Durant,Brooklyn Nets,SF;
James Harden,Brooklyn Nets,PG;
Kyrie Irving,Brooklyn Nets,SG;
Damian Lillard,Portland Trail Blazers,PG"""
player_infos_list = player_infos.split(';')
team_dict = {}

for player_str in player_infos_list:
    player = player_str.split(',')
    player_name = player[0].strip()
    player_team = player[1].strip()
    player_position = player[2].strip()
    player_info_dic = {"name": player_name, "team": player_team, "position": player_position}
    if player_team not in team_dict:
        team_dict[player_team] = []
    team_dict[player_team].append(player_info_dic)

teams = '|'.join(list(team_dict.keys()))
team = input(f"请输入你要查询的球队({teams}): ")
team_info = team_dict.get(team, [])

if not team_info:
    print("未找到该球队的信息，请检查输入是否正确。")
else:
    print_table_header()
    for player_info in team_info:
        print_player_info(player_info)
    print('+' + '-' * 67 + '+')